//
//  UIAlertView+Blocks.h
//  CommonLib
//
//  Created by dev on 13-6-3.
//  Copyright (c) 2013年 boxfishedu. All rights reserved.
//

#import <UIKit/UIKit.h>

typedef void (^DismissWithTextFieldBlock)(int buttonIndex, UITextField *textField);
typedef void (^DismissBlock)(int buttonIndex);
typedef void (^CancelBlock)();

@interface UIAlertView (Blocks)

+ (UIAlertView*)showAlertViewWithTitle:(NSString*)title
                                message:(NSString*)message
                      cancelButtonTitle:(NSString*)cancelButtonTitle
                      otherButtonTitles:(NSArray*)otherButtons
                              onDismiss:(DismissBlock)dismissed
                               onCancel:(CancelBlock)cancelled;

+ (UIAlertView*)showAlertViewWithTitle:(NSString*)title
                               message:(NSString*)message
                     cancelButtonTitle:(NSString*)cancelButtonTitle
                     otherButtonTitles:(NSArray*)otherButtons
                onDismissWithTextField:(DismissWithTextFieldBlock)dismissed
                              onCancel:(CancelBlock)cancelled;

+ (UIAlertView*)showAlertViewWithTitle:(NSString*)title
                               message:(NSString*)message
                     cancelButtonTitle:(NSString*)cancelButtonTitle
                     otherButtonTitles:(NSArray*)otherButtons
                           defaultText:(NSString*)defaultText
                onDismissWithTextField:(DismissWithTextFieldBlock)dismissed
                              onCancel:(CancelBlock)cancelled;

@end
